package com.example.take_out_dish.controller;

import com.example.take_out_admin_api.AdminClient;
import com.example.take_out_dish.common.Result;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {
    @Resource
    private AdminClient adminClient;

    @GetMapping("")
    public Result<Boolean> test(){
        boolean result = adminClient.validateToken("eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiYWRtaW4iLCJyb2xlIjoiIiwiYWRtaW5JZCI6IjEiLCJpYXQiOjE3MjA2MjYyNDksImV4cCI6MTcyMDYyOTg0OX0.cSRnMjz9AXmTzoCEXJs4zyuNu0cKuY-p8ssIjn5CI4I");
        log.info("result:{}",result);
        return Result.success(result);
    }
}
